# This file is part of BlackArch Linux ( http://blackarch.org ).
# See COPYING for license details.

pkgname=darkspiritz
pkgver=6.4d23e94
pkgrel=8
epoch=1
pkgdesc='A penetration testing framework for Linux, MacOS, and Windows systems.'
arch=('any')
groups=('blackarch' 'blackarch-exploitation' 'blackarch-automation')
url='https://github.com/M4cs/DarkSpiritz'
license=('MIT')
depends=('python' 'impacket' 'python-pysmb' 'python-pycryptodomex'
         'python-paramiko' 'python-scapy' 'python-requests'
         'python-terminaltables')
makedepends=('git')
source=("$pkgname::git+https://github.com/M4cs/DarkSpiritz.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/share/$pkgname"
  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  cp -a --no-preserve=ownership * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python start.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"

}

